Fixed minor memory leak on error
authorDr. Michael J. Chudobiak <mjc@xena.(none)>
Wed, 8 Apr 2009 14:33:08 +0000 (10:33 -0400)
committerDr. Michael J. Chudobiak <mjc@xena.(none)>
Wed, 8 Apr 2009 14:33:08 +0000 (10:33 -0400)
Bug 578290. Fixed a minor memory leak that occurs after a
memory allocation error. Found it using cppcheck.

gdk-pixbuf/io-jpeg.c

index da59386c164daa4f1a06b15d9d536405fb2b47ea..cf8c9ed19506d2500c9b79e207e22779969c5140 100644 (file)
@@ -1184,6 +1184,7 @@ real_save_jpeg (GdkPixbuf          *pixbuf,
                                             GDK_PIXBUF_ERROR,
                                             GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
                                             _("Couldn't allocate memory for loading JPEG file"));
+                       g_free (buf);
                       return FALSE;
               }
        }